package com.unknowpupil.design.strategy.demo;

/**
 * Created at 2020/12/10 by w10g <br>
 * Initialize DogComparator ... <br>
 *
 * @author unknowpupil
 * @since 0.0.1
 */
public class DogComparator implements Comparator<Dog> {


    @Override
    public int compare(Dog o1, Dog o2) {
        if (o1.weight > o2.weight) return 1;
        else if (o1.weight < o2.weight) return -1;
        else return 0;
    }
}
